name_list = ["name", "age", "count"]

print(name_list)

# 取值
print(name_list[0])

# 确定内容的位置
print(name_list.index("name"))

name_list[0] = "name1"

print(name_list[0])

# 增加元素
name_list.append("hehehe")
print("append: ", name_list)
name_list.insert(0, "hehe2")
print("insert: ", name_list)

# 删除所有元素
# name_list.clear()
print("clear: ", name_list)

# 删除
del name_list[0]
print("del: ", name_list)

temp_list = ["name1", "age1", "count1"]
name_list.extend(temp_list)
print("extend: ", name_list)

name_list.remove("name1")
name_list.remove("age1")
print("remove: ", name_list)

# 最右侧出队列
name_list.pop()
print("pop: ", name_list)
name_list.pop(0)
print("pop: ", name_list)

list_len = len(name_list)
print("list_len: ", list_len)

# 统计元素的个数
count = name_list.count("name1")
print("name1: ", count)

# 排序
name_list.sort()
print("sort: ", name_list)

# 倒序
name_list.sort(reverse=True)
name_list.reverse()
print("sort: ", name_list)
